package com.music.authority.dao.impl;

import java.util.Map;

import org.hibernate.SQLQuery;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.music.authority.dao.AuthorityDao;

@Repository
public class AuthorityDaoImpl implements AuthorityDao {

	@Autowired
	SessionFactory sessionFactory;
	
	@Override
	public void insertUser(Map<String, Object> param) {
		String sql="insert into t_user(id,name,email,pwd) values(:id,:name,:email,:pwd)";
		SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
		query.setParameter("id", param.get("id"));
		query.setParameter("name", param.get("name"));
		query.setParameter("email", param.get("email"));
		query.setParameter("pwd", param.get("pwd"));
		query.executeUpdate();
	}

}
